#!/bin/bash

config_file="$HOME/.config/i3/polybar/tray.ini"

sim = ';'

if grep -q "show = false" "$config_file"; then
    sed -i 's/show = false/show = true/' "$config_file"
    polybar tray --config=/home/$(whoami)/.config/i3/polybar/tray.ini &$sim echo $! > /tmp/polybar-tray
else
    sed -i 's/show = true/show = false/' "$config_file"
    kill $(cat /tmp/polybar-tray)
fi